<div id="ContentGroup">
    <div class="count-header">
        <a>新闻信息添加</a>
    </div>
    <div class="count-content-group">
        <div class="count-content">
            <form  id="XWXX_Insert" data-role="form" data-event="finish" data-type="post" data-url="<{'XWXX_Insert_Action'|U}>">
                <input type="hidden" id="XWXX_BH_ORA"  name="XWXX_BH_ORA" value="<{$Model->XWXX_BH|security_encript}>" />
                <div class="count-content-title">新闻信息</div>
                <div class="count-content-type"><{*此处添加全局注释*}></div>
                <div class="form-list-item">
                    <label class="form-list-item-label">新闻栏目</label>
                    <{*<{XWLM::create($Model->XWLM_BH)->XWLM_MC}>*}>
                    <{*<input type="hidden" name="XWLM_BH" value="<{$Model->XWLM_BH}>">*}>
                    <{$xwlm= XWLM::query()}>
                    <{'XWLM_BH'|html_dropdownlist:$xwlm.DataList:$Model->XWLM_BH:'XWLM_BH':'XWLM_MC'}>
                    <p class="form-list-item-tip"></p>
                </div>
                <div class="form-list-item">
                    <label class="form-list-item-label"><span style="color: red">*</span>标题</label>
                    <input type="text" id="XWXX_BT" name="XWXX_BT" value="<{$Model->XWXX_BT }>"/>
                    <p class="form-list-item-tip"></p>
                </div>
                <div class="form-list-item">
                    <label class="form-list-item-label"><span style="color: red">*</span>摘要</label>
                    <textarea id="XWXX_ZY" name="XWXX_ZY"><{$Model->XWXX_ZY }></textarea>
                    <p class="form-list-item-tip"></p>
                </div>
                <div class="form-list-item">
                    <label class="form-list-item-label"><span style="color: red">*</span>日期</label>
                    <input type="text" readonly="readonly" id="XWXX_RQ"  name="XWXX_RQ"  value="<{$Model->XWXX_RQ }>" />
                    <p class="form-list-item-tip"></p>
                </div>
                <div class="form-list-item">
                    <label class="form-list-item-label"><span style="color: red">*</span>状态</label>
                    <{'XWXX_ZT'|html_dropdownlist:["显示" , "隐藏"]:$Model->XWXX_ZT}>
                    <p class="form-list-item-tip"></p>
                </div>
                <div class="form-list-item">
                    <label class="form-list-item-label"><span style="color: red">*</span>类型</label>
                    <{'XWXX_LX'|html_dropdownlist:["超文本" , "超链接"]:$Model->XWXX_LX}>
                    <p class="form-list-item-tip"></p>
                </div>
                <div class="form-list-item">
                    <label class="form-list-item-label">超链接</label>
                    <input type="text" id="XWXX_CLJ" name="XWXX_CLJ" value="<{$Model->XWXX_CLJ }>"/>
                    <p class="form-list-item-tip">新闻类型为超链接是在此填写跳转的目标URL，否则不必填写</p>
                </div>
                <div class="form-list-item">
                    <label class="form-list-item-label">图片</label>
                    <input type="text" id="XWXX_TP"  name="XWXX_TP"  value="<{$Model->XWXX_TP }>" />
                    <span id="XWXX_TPImage" class="button" >选择图片</span>
                    <p class="form-list-item-tip">本地上传240*180的图片，或输入远程图片url</p>
                </div>
                <div class="count-content-title">内容</div>
                <div class="count-content-type"><{*此处添加全局注释*}></div>
                <div style="color: red;">推荐使用firefox、360(极速模式)、chrome、IE9以上、IE8兼容模式编辑；超文本内容建议直接粘贴纯文本。</div>
                <textarea id="XWXX_NR" name="XWXX_NR"><{$Model->XWXX_NR }></textarea>
            </form>     
            <div class="form-operation">
                <span class="button" id="XWXX_Insert-Submit">提交</span>
                <span class="button" data-role="back">返回</span>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {
        $("#ContentGroup").formset(0);//开启页面标签页
        //$("#XWXX_Insert").vtip();//开启鼠标提示.
        
        //客户端验证脚本
        $("#XWXX_Insert").validate({
            rules:{
                "XWXX_BH":{
                    "maxbytelength":50 ,
                    "required":true 
                }, 
                "XWLM_BH":{
                    "maxbytelength":50 ,
                    "required":true 
                }, 
                "XWXX_BT":{
                    "maxbytelength":200 ,
                    "required":true 
                }, 
                "XWXX_ZY":{
                    "maxbytelength":500 ,
                    "required":true 
                }, 
                "XWXX_RQ":{
                    "maxbytelength":50 ,
                    "required":true 
                }, 
                "XWXX_ZT":{
                    "maxbytelength":50 ,
                    "required":true 
                }, 
                "XWXX_LX":{
                    "maxbytelength":50 ,
                    "required":true 
                }, 
                "XWXX_CLJ":{
                    "maxbytelength":500 
                }, 
                "XWXX_TP":{
                    "maxbytelength":500 
                }, 
                "example":{} //可继续追加jquery validate客户端验证条件
            },
            "errorClass": "form-list-item-warn",
            //errorPlacement: function (error, element) {element.attr("data-tips", error.text());},//关闭默认提示，使用鼠标提示框时使用
            submitHandler: function () {
                $("#XWXX_Insert").trigger("finish");
            }
        });
    
        $("[name=XWXX_RQ]").datepicker({changeMonth: true,changeYear: true});
        var ue_xwxx_nr = new UE.ui.Editor({
        initialFrameHeight: 600  //初始化编辑器高度,默认600
        , iframeCssUrl: '__PUBLIC__/Styles/lib/ueditor/base.css' //请在__PUBLIC__/Styles/lib/ueditor下新建样式表并引用base.css
        });
        ue_xwxx_nr.render("XWXX_NR");
        $("#XWXX_TPImage").click(function(){
            $.imageUpload("XWXX_TP", 240, 180,$("#XWXX_TP").val(), function(data){
                $("#XWXX_TP").val(data);
            });
        });
        $("#XWXX_CLJ").attr("data-tip","新闻类型为超链接是在此填写跳转的目标URL，否则不必填写");
        $("#XWXX_TP").attr("data-tip","本地上传240*180的图片，或输入远程图片url");
        $("#XWXX_Insert-Submit").click(function () {
            $("#XWXX_Insert").submit();
        });
    });
</script>
